﻿using System;
using UnityEngine;

namespace UniRx.Triggers
{
	// Token: 0x0200043E RID: 1086
	[DisallowMultipleComponent]
	public class ObservableRectTransformTrigger : ObservableTriggerBase
	{
		// Token: 0x060016CB RID: 5835 RVA: 0x000625D0 File Offset: 0x000609D0
		public void OnRectTransformDimensionsChange()
		{
			if (this.onRectTransformDimensionsChange != null)
			{
				this.onRectTransformDimensionsChange.OnNext(Unit.Default);
			}
		}

		// Token: 0x060016CC RID: 5836 RVA: 0x000625F0 File Offset: 0x000609F0
		public IObservable<Unit> OnRectTransformDimensionsChangeAsObservable()
		{
			Subject<Unit> result;
			if ((result = this.onRectTransformDimensionsChange) == null)
			{
				result = (this.onRectTransformDimensionsChange = new Subject<Unit>());
			}
			return result;
		}

		// Token: 0x060016CD RID: 5837 RVA: 0x00062618 File Offset: 0x00060A18
		public void OnRectTransformRemoved()
		{
			if (this.onRectTransformRemoved != null)
			{
				this.onRectTransformRemoved.OnNext(Unit.Default);
			}
		}

		// Token: 0x060016CE RID: 5838 RVA: 0x00062638 File Offset: 0x00060A38
		public IObservable<Unit> OnRectTransformRemovedAsObservable()
		{
			Subject<Unit> result;
			if ((result = this.onRectTransformRemoved) == null)
			{
				result = (this.onRectTransformRemoved = new Subject<Unit>());
			}
			return result;
		}

		// Token: 0x060016CF RID: 5839 RVA: 0x00062660 File Offset: 0x00060A60
		protected override void RaiseOnCompletedOnDestroy()
		{
			if (this.onRectTransformDimensionsChange != null)
			{
				this.onRectTransformDimensionsChange.OnCompleted();
			}
			if (this.onRectTransformRemoved != null)
			{
				this.onRectTransformRemoved.OnCompleted();
			}
		}

		// Token: 0x04000CBF RID: 3263
		private Subject<Unit> onRectTransformDimensionsChange;

		// Token: 0x04000CC0 RID: 3264
		private Subject<Unit> onRectTransformRemoved;
	}
}
